package com.javalong.mir.pojo;

import com.javalong.mir.common.util.StringUtils;

/**
 * 用户信息
 * @author javalong
 *
 */
public class User extends BaseModel{
	private static final long serialVersionUID = 1863477588018430155L;
	private String nick;//昵称
	private String phone;//用户手机
	private String info;//个人介绍，机构
	private int hotnum;//热度，捐了几次项目
	private int donateProjectNum;//捐了几个项目
	private int donateMoney;//捐了多少钱
	private String avatarUrl;//头像地址
	private int level;//等级
	private String openid;//微信用户 id
	private int category;// 用户类型  0 普通用户 1 机构
	private String word;//一句话描述
	private String identifyUrl;//认证图片上传
	
	
	public String getWord() {
		return word;
	}
	public void setWord(String word) {
		this.word = word;
	}
	public String getIdentifyUrl() {
		return identifyUrl;
	}
	public void setIdentifyUrl(String identifyUrl) {
		this.identifyUrl = identifyUrl;
	}
	public String getNick() {
		return nick;
	}
	public void setNick(String nick) {
		this.nick = nick;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getInfo() {
		return info;
	}
	public void setInfo(String info) {
		this.info = info;
	}
	public int getHotnum() {
		return hotnum;
	}
	public void setHotnum(int hotnum) {
		this.hotnum = hotnum;
	}
	public int getDonateProjectNum() {
		return donateProjectNum;
	}
	public void setDonateProjectNum(int donateProjectNum) {
		this.donateProjectNum = donateProjectNum;
	}
	public int getDonateMoney() {
		return donateMoney;
	}
	public void setDonateMoney(int donateMoney) {
		this.donateMoney = donateMoney;
	}
	public String getAvatarUrl() {
		return avatarUrl;
	}
	public void setAvatarUrl(String avatarUrl) {
		this.avatarUrl = avatarUrl;
	}
	public int getLevel() {
		return level;
	}
	public void setLevel(int level) {
		this.level = level;
	}
	public String getOpenid() {
		return openid;
	}
	public void setOpenid(String openid) {
		this.openid = openid;
	}
	public int getCategory() {
		return category;
	}
	public void setCategory(int category) {
		this.category = category;
	}
	
	/**
	 * 不为空则更新
	 * @param updateUser
	 */
	public void updateUser(User updateUser) {
		if(updateUser==null)return;
		if(!org.springframework.util.StringUtils.isEmpty(updateUser.avatarUrl)){
			this.avatarUrl = updateUser.avatarUrl;
		}
		if(!org.springframework.util.StringUtils.isEmpty(updateUser.nick)){
			this.nick = updateUser.nick;
		}
		if(!org.springframework.util.StringUtils.isEmpty(updateUser.phone)){
			this.phone = updateUser.phone;
		}
		if(!org.springframework.util.StringUtils.isEmpty(updateUser.info)){
			this.info = updateUser.info;
		}
		if(!org.springframework.util.StringUtils.isEmpty(updateUser.identifyUrl)){
			this.identifyUrl = updateUser.identifyUrl;
		}
		if(!org.springframework.util.StringUtils.isEmpty(updateUser.word)){
			this.word = updateUser.word;
		}
	}

}
